﻿#include "time_sort_alg.h"

int main()
{
	TemplateVector<int> test;
	std::cout << "bubbleSort" << std::endl;
	countTimeSortUniqueValues(500,1,true, test, bubbleSort);
	countTimeSortUniqueValues(500, 100, true, test, bubbleSort);
	countTimeSortUniqueValues(500, 1, false, test, bubbleSort);
	countTimeSortUniqueValues(2500, 1, true, test, bubbleSort);
	countTimeSortUniqueValues(2500, 1, false, test, bubbleSort);
	std::cout << std::endl;
	TemplateVector<int> test2;
	std::cout << "heapSort" << std::endl;
	countTimeSortUniqueValues(500, 1, true, test2, heapSort);
	countTimeSortUniqueValues(500, 100, true, test2, heapSort);
	countTimeSortUniqueValues(500, 1, false, test2, heapSort);
	countTimeSortUniqueValues(2500, 1, true, test2, heapSort);
	countTimeSortUniqueValues(2500, 1, false, test2, heapSort);
	std::cout << std::endl;
	TemplateVector<int> test3;
	std::cout << "quickSort" << std::endl;
	countTimeSortUniqueValues(500, 1, true, test3, quickSort);
	countTimeSortUniqueValues(500, 100, true, test3, quickSort);
	countTimeSortUniqueValues(500, 1, false, test3, quickSort);
	countTimeSortUniqueValues(2500, 1, true, test3, quickSort);
	countTimeSortUniqueValues(2500, 1, false, test3, quickSort);

	system("pause");



	/*countTimeSortUniqueValues(500, test, heapSort);
	countTimeSortUniqueValues(500, test, quickSort);
	countTimeSortUniqueValues(5000, test, bubbleSort);
	countTimeSortUniqueValues(5000, test, heapSort);
	countTimeSortUniqueValues(5000, test, quickSort);
	countTimeSortUniqueValues(10000, test, bubbleSort);
	countTimeSortUniqueValues(10000, test, heapSort);
	countTimeSortUniqueValues(10000, test, quickSort);


	TemplateVector<int> unsort;
	unsort.pushBack(13);
	unsort.pushBack(4);
	unsort.pushBack(15);
	unsort.pushBack(4);
	unsort.pushBack(1);
	unsort.pushBack(78);
	unsort.pushBack(-5);

	bubbleSort(unsort, less);
	unsort.print();

	bubbleSort(unsort, more);
	unsort.print();


	TemplateVector<int> unsort2;
	unsort2.pushBack(13);
	unsort2.pushBack(4);
	unsort2.pushBack(15);
	unsort2.pushBack(4);
	unsort2.pushBack(1);
	unsort2.pushBack(78);
	unsort2.pushBack(-5);

	heapSort(unsort2, less);
	unsort2.print();

	heapSort(unsort2, more);
	unsort2.print();


	TemplateVector<int> unsort3;
	unsort3.pushBack(13);
	unsort3.pushBack(4);
	unsort3.pushBack(15);
	unsort3.pushBack(4);
	unsort3.pushBack(1);
	unsort3.pushBack(78);
	unsort3.pushBack(-5);

	quickSort(unsort3, less);
	unsort3.print();

	quickSort(unsort3, more);
	unsort3.print();*/



	
	//std::cout<<executionTime0.count();

	//testTimeAlg();
	

	//TemplateVector<int> unsort4;
	//unsort4.pushBack(13);
	//unsort4.pushBack(4);
	//unsort4.pushBack(15);
	//unsort4.pushBack(4);
	//unsort4.pushBack(1);
	//unsort4.pushBack(4);
	//unsort4.pushBack(78);
	//unsort4.pushBack(-5);

	//quickSort(unsort4, 0, unsort4.size() - 1, false);
	//unsort4.print();
	//quickSort(unsort4, 0, unsort4.size() - 1, true);
	//unsort4.print();

	////--------------------




	////-----------------------------------


	//TemplateVector<int> unsort5;
	//unsort5.pushBack(13);
	//unsort5.pushBack(4);
	//unsort5.pushBack(15);
	//unsort5.pushBack(4);
	//unsort5.pushBack(1);
	//unsort5.pushBack(4);
	//unsort5.pushBack(78);
	//unsort5.pushBack(-5);

	//heapSort(unsort5, unsort5.size(), true);
	//unsort5.print();
	//heapSort(unsort5, unsort5.size(), false);
	//unsort5.print();

	//
	////---------------------------------------------
	//

	//TemplateMultiVector<int>a(5, 7);
	//a.print();
	//std::cout << std::endl << std::endl;
	//fillMatrix(a);
	//a.print();

	//TemplateMultiVector<int>b(5, 7);
	//b.print();
	//spiral(b);
	//b.print();
	//
	//TemplateMultiVector <int> A;
	//TemplateMultiVector<int> B(2, 2);
	//TemplateMultiVector<int> C = B;
	//C.print();
	//C[1][1] = 666;
	//std::cout<<C.at(1, 1)<<std::endl;
	//TemplateVector<int> d;
	//d.pushBack(1);
	//d.pushBack(2);
	//C.pushBackRow(d);
	//C.print();
	//d.pushBack(3);
	//C.pushBackCol(d);
	//C.print();
	//C.removeLastRow();
	//C.print();
	//C.removeLastCol();
	//C.print();
	//C.resize(4, 4);
	//C.print();
	//d.pushBack(4);
	//C.insertRow(10, d);
	//C.print();
	//C.resize(4, 4);
	//C.insertCol(1,d);
	//C.print();
	//TemplateMultiVector <int> E;
	//E = C;
	//E.print();
	//std::cout << E[0][1];


	//TemplateMultiVector<int> s(3,3);    // # # #
 //                                       // # # #
	//                                    // # # #
	//s.print();

	//TemplateVector<int> ss;
	//ss.pushBack(1);
	//ss.pushBack(2);
	//ss.pushBack(3);
	//ss.print();                        
	//s.pushBackRow(ss);                 // # # # 
	//                                   // # # #
	//                                   // # # #
	//                                   // 1 2 3
	//s.print();
	//ss.pushBack(4);
	//ss.print();
	//s.pushBackCol(ss);                 // # # # 1
	//                                   // # # # 2
	//                                   // # # # 3
	//                                   // 1 2 3 4
	//s.print();

	//s.resize(5, 5);                    
	//s.print();                         // # # # 1 #
	//                                   // # # # 2 #
	//                                   // # # # 3 #
	//                                   // 1 2 3 4 #
	//								   // # # # # #   
	//TemplateMultiVector<char>ch(3, 3);
	//
	//TemplateVector<char> c;
	//c.pushBack('a');
	//c.pushBack('b');
	//c.pushBack('c');
	//
	//ch.pushBackRow(c);
	//c.pushBack('d');
	//ch.pushBackCol(c);
	//ch.print();
}